<?php

namespace app\common\model\Subject;

use think\Model;

use traits\model\SoftDelete;

class Order extends Model
{
    use SoftDelete;

    // 课程订单表
    protected $table = 'pre_subject_order';

    // 开启自动写入时间
    protected $autoWriteTimestamp = 'int';

    // 定义时间戳字段名
    protected $createTime = 'createtime';
    protected $updateTime = false;

    // 定义软删除字段
    protected $deleteTime = 'deletetime';

    public function subject()
    {
        return $this->belongsTo('app\common\model\Subject\Subject','subid','id',[],'LEFT')->setEagerlyType(0);
    }

    public function business()
    {
        return $this->belongsTo('app\common\model\Business\Business','busid','id',[],'LEFT')->setEagerlyType(0);
    }
}
